import request from '@/sheep/request';

export default {
  // 优惠券
  list: (params) =>
    request({
      url: 'coupon',
      method: 'GET',
      params,
      custom: {
        showLoading: false,
      },
    }),
  userCoupon: (params) =>
    request({
      url: 'user.coupon',
      method: 'GET',
      params,
    }),
  detail: (id, user_coupon_id) =>
    request({
      url: 'coupon/detail',
      method: 'GET',
      params: {
        id: id,
        user_coupon_id,
      },
    }),
  get: (id) =>
    request({
      url: 'coupon/get',
      method: 'POST',
      params: {
        id: id,
      },
    }),
  listByGoods: (id) =>
    request({
      url: 'coupon/listByGoods',
      method: 'GET',
      params: {
        goods_id: id,
      },
    }),
	// 优惠券升级
	upgrade: (user_coupon_id) =>
	  request({
	    url: '/addons/shopro/user.coupon/upgrade',
	    method: 'POST',
	    params: {
	      user_coupon_id
	    },
	  }),
	  
	  // 优惠券赠送
	  couponZengsong: (data) =>
	    request({
	      url: '/addons/shopro/user.coupon/present',
	      method: 'POST',
	      params: {
	        user_coupon_id:data.user_coupon_id,
			mobile:data.mobile
	      },
	    }),
};
